// Kurtz and Brooks 2008 WP

// REPLICATION
clear
use "KB2008 WP Rep Data.dta"
summarize
display c(k)
mdesc
codebook countryc
codebook year
summarize

// Table 3
// Model 1
xtpcse  factoradd partisan_final partisan_union union9195 maj mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise
codebook year if e(sample)
codebook countryc if e(sample)

// Model 2
xtpcse  factordiff partisan_final partisan_union union9195 maj mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise
codebook year if e(sample)
codebook countryc if e(sample)

// Model 3
xtpcse  factoradd partisan_final partisan_union union9195 maj pr mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise
codebook year if e(sample)
codebook countryc if e(sample)

// Model 4
xtpcse  factordiff partisan_final partisan_union union9195 maj pr mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise
codebook year if e(sample)
codebook countryc if e(sample)

// IMPUTATION
clear
use "KB2008 WP Imp Data.dta"
summarize

mi import flong, m(imp) id(year countrynumber) imp(tradereform-gdp_capita_ppp_2000usd)

mi xtset countrynumber year

// Table 3
// Model 1
mi estimate, cmdok post: xtpcse  factoradd partisan_final partisan_union union9195 maj mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise

// Model 2
mi estimate, cmdok post: xtpcse  factordiff partisan_final partisan_union union9195 maj mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise

// Model 3
mi estimate, cmdok post: xtpcse  factoradd partisan_final partisan_union union9195 maj pr mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise

// Model 4
mi estimate, cmdok post: xtpcse  factordiff partisan_final partisan_union union9195 maj pr mfg80 yrschool gini80 growth80s democracy trade_gdp imfcred_gdp wbgdp lninfl_adj curracct_gdp unemployment agedep gdp_capita_ppp_2000usd lngdp yearzero if year>1984, c(ar1) pairwise

